package com.example.service2.controller;

import com.example.service2.feign.TestFeignService;
import com.example.service2.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @oauth Yeohwah
 * @createDate 2021/10/16
 * @info
 */
@RestController
@RequestMapping("/service")
public class TestController {

    @Autowired
    private TestFeignService testFeignService;
    @Autowired
    private TestService testService;

    @RequestMapping("/info")
    public String info(){
        String info = testFeignService.info();
        return "serivce2"+"========="+info;
    }

    @RequestMapping("/save")
    public String save(){
        String info = testFeignService.save();
        return "serivce2"+"========="+info;
    }

    @RequestMapping("/saveAll")
    public String saveAll(){
        String info1 = testFeignService.save1();
        String info2 = testFeignService.save2();
        return "serivce2"+"========="+info1 + info2;
    }

    @RequestMapping("/bizSaveAll")
    public String bizSaveAll(){
        String s = testService.bizSaveAll();
        return "serivce2" + s;
    }
}
